home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Yerk 3.64 / Supplement / Unsupported / Utilities / Blackout next >
Text File  |  1986-02-08  |  1KB  |  49 lines

  1. ( Blackout - Paints the entire Macintosh screen black and waits for <cr> )
  2.  
  3. :CLASS  ViewPort  <Super GrafPort
  4.  
  5.   ( -- ) ( Initialize the grafport structure )
  6.   :M  NEW:     (abs) call OpenPort ;M
  7.  
  8.   ( -- ) ( Paint the whole grafport rectangle )
  9.   :M  Paint:   paint: PortRect ;M
  10.  
  11. ;CLASS 
  12.  
  13. ViewPort Port
  14.  
  15. : ScreenBits
  16.     $ 904 -base @ ( currentA5 -- )
  17.     -base @       ( <address of quickdraw globals> -- )
  18.     $ FFFFFF86 +  ( <address of screenbits> -- )
  19.     $ 6 +         ( <address of bounds rect> -- )
  20.     dup           ( adr adr -- )
  21.     -base @       ( adr <first point>  -- )
  22.     unpack        ( adr l t  -- )
  23.     rot           ( l t adr -- )
  24.     $ 4 +         ( l t <adr of second point> -- )
  25.     -base @       ( l t point -- )
  26.     unpack        ( l t r b )
  27. ;
  28.  
  29. ( WaitCR - waits for a <cr> )
  30. : WaitCR BEGIN $ 0D key = UNTIL ;
  31.  
  32. ( hidemouse - hides the cursor )
  33. : HideMouse call HideCursor ;
  34.  
  35. ( showmouse - shows the cursor )
  36. : ShowMouse call ShowCursor ;
  37.  
  38. ( BlackOut - the word that starts it all )
  39. : BlackOut
  40.     HideMouse
  41.     SavePort
  42.     New: Port
  43.     ScreenBits PutRect: Port
  44.     Paint: Port
  45.     WaitCR
  46.     ShowMouse
  47.     RestPort
  48. ;
  49.